function values(tb)
     local i = 0
     return function ()
          i = i+1 
          return tb[i]
     end
end

local testTb = {10, 20, 30}
for value in values(testTb) do
     print(value)
end